package com.jrx.anytxn.param.job.bactchBillCompare.step;

import com.jrx.anytxn.param.entity.TlBillTransCompareDetail;
import com.jrx.anytxn.param.mapper.ext.ExtTlBillTransCompareDetailMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.batch.item.ItemWriter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BillDetailUnmatchedWriter implements ItemWriter<TlBillTransCompareDetail> {

    @Resource
    private ExtTlBillTransCompareDetailMapper extTlBillTransCompareDetailMapper;

    @Override
    public void write(List<? extends TlBillTransCompareDetail> items) throws Exception {
        if(CollectionUtils.isNotEmpty(items)){
            extTlBillTransCompareDetailMapper.insertbatch((List<TlBillTransCompareDetail>) items);
        }
    }
}
